﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BT_web__nhom06.VanPhongDoan
{
    public partial class Xoa_CD : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Label2.Text = Request.QueryString["id"];
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            int ketqua = 0;
            string machidoan = Request.QueryString["id"];
            string lenhsql = "delete from chidoan where machidoan = @machidoan";
            ketqua = Tienichsql.ketnoicsdl.chaylenhcapnhatdulieu(lenhsql, new string[] { "@machidoan" }, new object[] { machidoan });
            if (ketqua == 1)
            {
                Label1.Text = "Da xoa";
                Button2.Text = "Quay lại";
                Button1.Visible = false;
            }
            else
                Label1.Text = "Co su co xay ra!";
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            Response.Redirect("QL_ChiDoan.aspx");
        }
    }
}